home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2000 October
/
PCWorld_2000-10_cd1.bin
/
Software
/
Vyzkuste
/
tiptrik
/
tiptrik.exe
/
soubory pro pcw 10 - æikovn¡ pomocn¡ci pro vaçe Windows
/
skripty
/
close.vbs
< prev
next >
Wrap
Text File
|
2000-08-28
|
3KB
|
104 lines
'================================================
dim ordner(40)
Set dat = CreateObject("Scripting.FileSystemObject")
Set MyShell=Wscript.CreateObject("Wscript.Shell")
w = WScript.ScriptFullName
Set a = dat.OpenTextFile(w, 1)
Set b = dat.CreateTextFile("c:\$tmp$.BAT", True)
do
n=n+1
zeile=a.readline
ordner(n)=mid(zeile,2)
loop until instr(ordner(n),"========")
code=a.readall
a.Close
for x = 1 to n - 1
liste = liste & chr(13) & chr(10) & ordner(x)
next
if n > 1 then
modus = MyShell.Popup ("Chcete zablokovat dalÜφ slo₧ku?",,"",3)
else
modus = 6
end if
if modus=2 then
wscript.quit
else
if modus=6 then
WinDisable
else
WinEnable
end if
end if
a.Writeline "'================================================"
a.Write code
a.Close
b.close
MyShell.run "command.com /c c:\$tmp$.BAT",2,True
set del=dat.Getfile("c:\$tmp$.BAT")
del.delete
Sub WinDisable()
Set a = dat.CreateTextFile(w, True)
for x = 1 to n - 1
a.writeline "'" & ordner(x)
next
do
verz=inputbox("Zadejte cestu ke slo₧ce, kterou chcete zablokovat" & chr(13) & chr(10) & liste)
if verz <> "" then
on error resume next
set check=dat.getfolder(verz)
if err.Number = 0 then
a.writeline "'" & verz
befehl="ren " & chr(34) & verz & chr(34) & " " & chr(34) & chr(223) & check.name & chr(34)
b.writeline befehl
liste=liste & chr(13) & chr(10) & verz
else
msgbox "Zadanß slo₧ka neexistuje!"
err.clear
end if
end if
loop until verz=""
end sub
sub WinEnable()
Set a = dat.CreateTextFile(w, True)
frei=MyShell.popup("Chcete odblokovat vÜechny chrßn∞nΘ slo₧ky?" & chr(13) & chr(10) & liste,,"",4)
if frei = 6 then
for x = 1 to n - 1
nurname=ordner(x)
do
i=instr(nurname,"\")
if i > 0 then nurname=mid(nurname,i+1)
loop until i=0
vorne=len(ordner(x))-len(nurname)
befehl="ren " & chr(34) & left(ordner(x),vorne) & chr(223) & nurname & chr(34) & " " & chr(34) & nurname & chr(34)
b.writeline befehl
next
end if
if frei = 7 then
for x = 1 to n - 1
frei=MyShell.popup(ordner(x) & " Odblokovat?",,"",4)
if frei=7 then a.writeline "'" & ordner(x)
if frei=6 then
nurname=ordner(x)
do
i=instr(nurname,"\")
if i > 0 then nurname=mid(nurname,i+1)
loop until i=0
vorne=len(ordner(x))-len(nurname)
befehl="ren " & chr(34) & left(ordner(x),vorne) & chr(223) & nurname & chr(34) & " " & chr(34) & nurname & chr(34)
b.writeline befehl
end if
next
end if
end sub